import 'dart:convert' show json;

class HomeRecommendResult {

  bool success;
  String code;
  String message;
  Entity entity;

  HomeRecommendResult.fromParams({this.success, this.code, this.message, this.entity});

  factory HomeRecommendResult(jsonStr) => jsonStr == null ? null : jsonStr is String ? HomeRecommendResult.fromJson(json.decode(jsonStr)) : HomeRecommendResult.fromJson(jsonStr);

  HomeRecommendResult.fromJson(jsonRes) {
    success = jsonRes['success'];
    code = jsonRes['code'];
    message = jsonRes['message'];
    entity = jsonRes['entity'] == null ? null : Entity.fromJson(jsonRes['entity']);
  }

  @override
  String toString() {
    return '{"success": $success, "code": ${code != null?'${json.encode(code)}':'null'}, "message": ${message != null?'${json.encode(message)}':'null'}, "entity": $entity}';
  }
}

class Entity {

  GoodsSearchReponseEntity goods_search_response;

  Entity.fromParams({this.goods_search_response});

  Entity.fromJson(jsonRes) {
    goods_search_response = jsonRes['goods_search_response'] == null ? null : GoodsSearchReponseEntity.fromJson(jsonRes['goods_search_response']);
  }

  @override
  String toString() {
    return '{"goods_search_response": $goods_search_response}';
  }
}

class GoodsSearchReponseEntity {

  int total_count;
  List<GoodsListBean> goods_list;

  GoodsSearchReponseEntity.fromParams({this.total_count, this.goods_list});

  GoodsSearchReponseEntity.fromJson(jsonRes) {
    total_count = jsonRes['total_count'];
    goods_list = jsonRes['goods_list'] == null ? null : [];

    for (var goods_listItem in goods_list == null ? [] : jsonRes['goods_list']){
      goods_list.add(goods_listItem == null ? null : GoodsListBean.fromJson(goods_listItem));
    }
  }

  @override
  String toString() {
    return '{"total_count": $total_count, "goods_list": $goods_list}';
  }
}

class GoodsListBean {

  Object goods_gallery_urls;
  Object platform;
  int avg_desc;
  int avg_lgst;
  int avg_serv;
  int awardAmount;
  int category_id;
  int coupon_discount;
  int coupon_end_time;
  int coupon_min_order_amount;
  int coupon_price;
  int coupon_remain_quantity;
  int coupon_start_time;
  int coupon_total_quantity;
  int create_at;
  int goods_eval_count;
  int goods_eval_score;
  int goods_id;
  int mall_cps;
  int mall_id;
  int merchant_type;
  int min_group_price;
  int min_normal_price;
  int plusAmount;
  int promotion_amount;
  int promotion_rate;
  int sold_quantity;
  double desc_pct;
  double lgst_pct;
  double serv_pct;
  bool has_coupon;
  String category_name;
  String goods_image_url;
  String goods_name;
  String goods_thumbnail_url;
  String mall_name;
  String mall_type;
  String opt_name;
  String sales_tip;

  GoodsListBean.fromParams({this.goods_gallery_urls, this.platform, this.avg_desc, this.avg_lgst, this.avg_serv, this.awardAmount, this.category_id, this.coupon_discount, this.coupon_end_time, this.coupon_min_order_amount, this.coupon_price, this.coupon_remain_quantity, this.coupon_start_time, this.coupon_total_quantity, this.create_at, this.goods_eval_count, this.goods_eval_score, this.goods_id, this.mall_cps, this.mall_id, this.merchant_type, this.min_group_price, this.min_normal_price, this.plusAmount, this.promotion_amount, this.promotion_rate, this.sold_quantity, this.desc_pct, this.lgst_pct, this.serv_pct, this.has_coupon, this.category_name, this.goods_image_url, this.goods_name, this.goods_thumbnail_url, this.mall_name, this.mall_type, this.opt_name, this.sales_tip});

  GoodsListBean.fromJson(jsonRes) {
    goods_gallery_urls = jsonRes['goods_gallery_urls'];
    platform = jsonRes['platform'];
    avg_desc = jsonRes['avg_desc'];
    avg_lgst = jsonRes['avg_lgst'];
    avg_serv = jsonRes['avg_serv'];
    awardAmount = jsonRes['awardAmount'];
    category_id = jsonRes['category_id'];
    coupon_discount = jsonRes['coupon_discount'];
    coupon_end_time = jsonRes['coupon_end_time'];
    coupon_min_order_amount = jsonRes['coupon_min_order_amount'];
    coupon_price = jsonRes['coupon_price'];
    coupon_remain_quantity = jsonRes['coupon_remain_quantity'];
    coupon_start_time = jsonRes['coupon_start_time'];
    coupon_total_quantity = jsonRes['coupon_total_quantity'];
    create_at = jsonRes['create_at'];
    goods_eval_count = jsonRes['goods_eval_count'];
    goods_eval_score = jsonRes['goods_eval_score'];
    goods_id = jsonRes['goods_id'];
    mall_cps = jsonRes['mall_cps'];
    mall_id = jsonRes['mall_id'];
    merchant_type = jsonRes['merchant_type'];
    min_group_price = jsonRes['min_group_price'];
    min_normal_price = jsonRes['min_normal_price'];
    plusAmount = jsonRes['plusAmount'];
    promotion_amount = jsonRes['promotion_amount'];
    promotion_rate = jsonRes['promotion_rate'];
    sold_quantity = jsonRes['sold_quantity'];
    desc_pct = jsonRes['desc_pct'];
    lgst_pct = jsonRes['lgst_pct'];
    serv_pct = jsonRes['serv_pct'];
    has_coupon = jsonRes['has_coupon'];
    category_name = jsonRes['category_name'];
    goods_image_url = jsonRes['goods_image_url'];
    goods_name = jsonRes['goods_name'];
    goods_thumbnail_url = jsonRes['goods_thumbnail_url'];
    mall_name = jsonRes['mall_name'];
    mall_type = jsonRes['mall_type'];
    opt_name = jsonRes['opt_name'];
    sales_tip = jsonRes['sales_tip'];
  }

  @override
  String toString() {
    return '{"goods_gallery_urls": $goods_gallery_urls, "platform": $platform, "avg_desc": $avg_desc, "avg_lgst": $avg_lgst, "avg_serv": $avg_serv, "awardAmount": $awardAmount, "category_id": $category_id, "coupon_discount": $coupon_discount, "coupon_end_time": $coupon_end_time, "coupon_min_order_amount": $coupon_min_order_amount, "coupon_price": $coupon_price, "coupon_remain_quantity": $coupon_remain_quantity, "coupon_start_time": $coupon_start_time, "coupon_total_quantity": $coupon_total_quantity, "create_at": $create_at, "goods_eval_count": $goods_eval_count, "goods_eval_score": $goods_eval_score, "goods_id": $goods_id, "mall_cps": $mall_cps, "mall_id": $mall_id, "merchant_type": $merchant_type, "min_group_price": $min_group_price, "min_normal_price": $min_normal_price, "plusAmount": $plusAmount, "promotion_amount": $promotion_amount, "promotion_rate": $promotion_rate, "sold_quantity": $sold_quantity, "desc_pct": $desc_pct, "lgst_pct": $lgst_pct, "serv_pct": $serv_pct, "has_coupon": $has_coupon, "category_name": ${category_name != null?'${json.encode(category_name)}':'null'}, "goods_image_url": ${goods_image_url != null?'${json.encode(goods_image_url)}':'null'}, "goods_name": ${goods_name != null?'${json.encode(goods_name)}':'null'}, "goods_thumbnail_url": ${goods_thumbnail_url != null?'${json.encode(goods_thumbnail_url)}':'null'}, "mall_name": ${mall_name != null?'${json.encode(mall_name)}':'null'}, "mall_type": ${mall_type != null?'${json.encode(mall_type)}':'null'}, "opt_name": ${opt_name != null?'${json.encode(opt_name)}':'null'}, "sales_tip": ${sales_tip != null?'${json.encode(sales_tip)}':'null'}}';
  }
}